<template>
  <div class="all">
    <div class="header">
      <el-row class="top">
        <el-col :span="13">欢迎来到媒介兔!</el-col>
        <el-col :span="11">
          <ul style="float:right">
            <li v-if="userdata" class="red">{{userdata.phone}} <span @click="zhuxiao">注销</span> </li>
            <nuxt-link tag="li" to="/user">我的消息</nuxt-link>
            <li>入住媒体</li>
            <li>在线客服</li>
            <li>客服热线 027-8888-888</li>
          </ul>
        </el-col>
      </el-row>
    </div>
    <div class="h">
      <div class="search">
        <nuxt-link to="/" class="logo" tag="div"></nuxt-link>
      </div>
    </div>
    <nuxt/>
    <div class="layoutfooter">
            <div class="layoutfooterContent">
                <div class="lFCitem">
                    <p>常见问题</p>
                    <p>广告主</p>
                    <p>媒体主</p>
                    <p>帮助中心</p>
                </div>
                <div class="lFCitem">
                    <p>交易保障</p>
                    <p>资金安全</p>
                    <p>交易规则</p>
                </div>
                <div class="lFCitem">
                    <p>联系客服</p>
                    <p>业务咨询</p>
                    <p>售后服务</p>
                    <p>资金客服</p>
                </div>
                 <div class="lFCitem">
                    <p>关于我们</p>
                    <p>公司简介 </p>
                    <p>商务合作</p>
                    <p>用户协议</p>
                </div>
                <div class="servicephone">
                    <div>
                        <p><i class="el-icon-phone-outline"></i> 全国客服热线</p>
                        <p>027-133212</p>
                        <p class="font14">每日 9:00 - 18:00</p>
                    </div>
                </div>
                <div class="erweima">
                    <div></div>
                    <p class="tac">二维码</p>
                </div>
            </div>
        </div>
        <div class="layoutfooter fff">
            <div class="layoutbotton">
                <div>鄂ICP备19013711号-1</div>
                <div>媒介兔(www.meijietu.cn)</div>
                <div>版本所有权:武汉中帜云媒网络</div>
                <div class="fr">举报邮箱:jubao@qq.com</div>
            </div>
        </div>
  </div>
</template>

<script>
import {gettoken} from '@@/assets/commen.js'
export default {
  data() {
    return {
      userdata:''
    }
  },
  methods: {
    zhuxiao(){
      this.$axios.post('/signOut',{},{headers:{'Authorization':'Bearer'+localStorage.getItem('access_token')}}).then(res => {
        console.log(res)
        this.$router.push('/')
      })
    }
  },
  mounted() {
     gettoken().then(val =>{                 //刷新TOKEN,获取用户信息并记录
      if(val){
        this.$axios.post('/me',{},{headers:{'Authorization':'Bearer'+val}}).then(res =>{
        localStorage.setItem('userdata',JSON.stringify(res.data.data))
        this.userdata = res.data.data
      })
      }else{
        console.log('请登录')
        // this.$router.push('/login')
      }
    }).catch(err => {
      console.log(err)
    })
  },
};
</script>

<style scoped>
.userfooter{
  background-color: #000;
  height: 118px;
}
.usercontent{
  width: 1000px;
  /* min-height: 625px; */
  float: right;
  position: absolute;
  right: 0;
  top: 0;
}
.navMenu{
  width: 170px;
  height: 625px;
  background-color: #fff;
  overflow: hidden;
  border-radius: 5px;
}
.all {
  background-color: #f7f7f7;
}
a {
  text-decoration: none;
}
.top {
  display: flex;
  align-items: center;
}
.top ul li {
  list-style: none;
  float: left;
  padding: 0 10px;
  height: 13px;
  border-right: 1px #000 solid;
}
.top a {
  text-decoration: none;
  margin: 0 10px;
}
.top a.denglu {
  color: red;
}
.header {
  width: 100%;
  background-color: #f7f7f7;
  height: 33px;
}
.header .top {
  font-size: 12px;
  color: #656565;
  width: 1200px;
  margin: 0 auto;
  height: 100%;
}
.w {
  width: 100%;
  height: 126px;
  background-color: #f7f7f7;
}
.search {
  display: flex;
  width: 1200px;
  margin: 0 auto;
  margin-bottom: 30px;
  height: 86px;
  align-items: center;
}
.h {
  width: 100%;
  background-color: #fff;
}
.logo {
  width: 158px;
  height: 42px;
  background: url("/logo.png");
}
</style>
